{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Modelling with RBC\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Introduction\n",
    "\n",
    "Here, we'll see an example of macro modelling: a real business cycle model. This example is due to [Chad Fulton](http://www.chadfulton.com/).\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import statsmodels.formula.api as smf\n",
    "from sympy import *\n",
    "from numpy.random import Generator, PCG64\n",
    "\n",
    "# Set max rows displayed for readability\n",
    "pd.set_option(\"display.max_rows\", 6)\n",
    "# Plot settings\n",
    "plt.style.use(\n",
    "    \"https://github.com/aeturrell/coding-for-economists/raw/main/plot_style.txt\"\n",
    ")\n",
    "# Set seed for random numbers\n",
    "seed_for_prng = 78557\n",
    "prng = Generator(PCG64(seed_for_prng))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Model specification\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$\n",
    "\\max \\mathbb{E}_0 \\sum_{t=0}^\\infty \\beta^t u(c_t, l_t)\n",
    "$$\n",
    "\n",
    "the budget constraint: yt=ct+it\n",
    "the capital accumulation equation: kt+1=(1−δ)kt+it\n",
    "1=lt+nt\n",
    "\n",
    "where households have the following production technology:\n",
    "\n",
    "$$\n",
    "y_t = z_t f(k_t, n_t)\n",
    "$$\n",
    "and where the (log of the) technology process follows an AR(1) process:\n",
    "\n",
    "$$\n",
    "\\log z_t = \\rho \\log z_{t-1} + \\varepsilon_t, \\qquad \\varepsilon_t \\sim N(0, \\sigma^2)\n",
    "$$"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "codeforecon",
   "language": "python",
   "name": "codeforecon"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.6-final"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
